package com.zcl.utils;

import java.util.Vector;

import android.app.Activity;
import android.os.Build;
import android.os.Environment;
import android.text.TextUtils;
import android.util.DisplayMetrics;

/**
 * 日程管家中使用到的变量
 * 
 * @author sunhang
 * 
 */
public class Value {

    /**
     * 开关区域，包含如下开关
     * 
     * 日志开关 printLog 用于控制开发日志的输出，具体比如Log.d,Log.e,NqLog.d,NqLog.e等.输出位置为console trace_inner_log
     * 用于内部问题追踪的日志输出，输出位置为日志数据库，可以采用测试工具查看（异常表) printNetLog 网路日志输出，输出位置为console。不建议继续使用。采用printLog替代
     * usage_log 用户使用软件的操作记录。可以采用日志查看工具查看。位置为操作历史表。作为日志上传协议37的数据源 trace_err_log
     * 用户使用软件时的异常，错误日志。用于改进软件使用。作为日志上传协议37的数据源。
     * 
     * 
     * 自动登录开关（仅用于monkey等模拟工具的自动测试，其他情况不允许打开） monkey_test
     * 
     * 
     * 注意事项: 发布版本时确认如下开关已经关闭 printLog trace_inner_log printNetLog monkey_test
     */
    public static boolean printLog; // 是否 输出日志
    public static boolean trace_inner_log;// 内部版本用日志，发布时一定关闭
    public static boolean printNetLog; // 是否输出网络步骤时间点出日志
    public static boolean usage_log;// 用户操作历史日志，为37协议准备数据用
    public static boolean trace_err_log;// 追踪错误日志
    /** 进行monkey测试的标志(是否进行不用登录直接进入程序，为真时，跳过登录注册流程，使用测试帐号进入程序，为假时程序走正常登录注册流程) */
    public static boolean monkey_test;
    /** 测试使用软件UID */
    public static final String TEST_UID = "62701236";
    /** 测试使用用户名 */
    public static final String TEST_USERNAME = "18610210795";
    /** 测试使用密码 */
    public static final String TEST_PASSWORD = "111111";
    /** 测试使用绑定手机号 */
    public static final String TEST_BINDPHONE = "18610210795";

    static {
        // 发布时务必修改为false
        printLog = true; // 是否 输出日志，发布时一定关闭
        trace_inner_log = false;// 内部版本用日志，发布时一定关闭

        // 不建议修改项目
        printNetLog = false; // 是否输出网络步骤时间点出日志
        usage_log = true;// 用户操作历史日志，为37协议准备数据用
        trace_err_log = true;// 追踪错误日志

        /** 进行monkey测试的标志(是否进行不用登录直接进入程序，为真时，跳过登录注册流程，使用测试帐号进入程序，为假时程序走正常登录注册流程) */
        monkey_test = false;
    }

    public static String model = null;
    public static String imei = null;
    public static String imsi = null;

    public static final int VERSION = 8; // 程序版本号，用于节日数据库的升级
    public static final String Svn_Version = "8"; // svn版本号，暂时写死，等有空修改成编译时动态生成

    public static int mDateLen = 10; // "####/##/##"
    public static int mFirstTipTime = 30;
    public static int mSecondTiptime = 5;
    public static int mFlightTipTime = 5 * 60;

    public static final int WAIT_SMS_TIME = 60000; // 等待短信的时间
    // 跳转到主页的标识
    public static final String EXTRA_LAUNCH_FLAG = "launch_type";
    // 操作系统标识(平台ID)
    public static final String OS = "351";
    // 业务类型标识（业务ID）
    public static final String ID = "121";
    // 产品ID
    public static final String Business = "121";
    // 版本标识（Edition ID）
    public static final String Version = "13018";

    // 合作伙伴标识
    public static String Partner = "0";// "1378";"华为" // "1410"; // 2124：google market

    // 联网时选用的APN的ID
    // public static final int NET_ID = 3;

    public static int NET_ID = 3;
    // 模拟器还是真机

    public static String mSmsConfirmNumber = ""; // 确认短信号码
    public static String mSmsConfirmContent = ""; // 确认短信内容
    public static String mSmsNumberMatch = ""; // 回复短信号码，需要确保实际回复短信号码匹配成功
    public static String mSmsContentMatch = ""; // 回复短信内容，需要确保实际回复短信内容匹配成功

    public static final int DB_CHANGE_MSG_VALUE = 100; // 程序数据库变化的消息
    public static final int PREF_CHANGE_MSG_VALUE = 200; // 配置变化变化的消息
    public static final int SMS_CHANGE_MSG_VALUE = 300; // 系统短信变化的消息
    public static final int CALLLOG_CHANGE_MSG_VALUE = 301; // 电话记录变化的消息
    public static final int USER_CONFIRM_MSG_VALUE = 302; // 用户确认或者取消的消息
    public static final int SHOW_WAIT_DIALOG_MSG_VALUE = 303; // 主界面显示等待Dialog的消息
    public static final int NET_MSG_VALUE = 400; // 网络消息的值
    public static final int INCOMING_CALL_MSG_VALUE = 401; // 来电消息的值
    public static final int RECEIVE_SUBSCRIBE_SMS_VALUE = 402; // 收到订购短信的回复消息
    public static final int NET_PROCESS_END_MSG_VALUE = 403; // 网络处理结束的消息
    public static final int SOFT_UPDATE_REMIND_MSG_VALUE = 404; // 软件更新提示消息
    public static final int RECHARGE_SMS_TIMEOUT_MSG_VALUE = 405; // 订购短信超时消息
    public static final int SCHEDULE_TIME_REACHING = 901;
    public static final int MESSAGE_LOGOUT = 902; // 注销
    public static final int MESSAGE_SWITCH_ACCOUNT = 903; // 切换帐号成功
    public static final int MESSAGE_EXIT_APP = 904; // 退出程序
    public static final int MESSAGE_FINISH_NETQIN_TAB_MAIN = 905; // finish掉NetqinTabMain
    public static final int NEW_FEEDS = 906; // 有新的动态
    public static final int DISMISS_FEEDS = 907; // 取消掉动态
    public static final int LOGGED_IN = 908; // 登录成功
    public static final int JUMP_FRIEND_FUN = 909; // 跳转到好友
    public static final int SWITCH_2_EXTRA_LAUNCH_SCHEDULE = 910;

    public static final int NET_UINOTIFY_WAIT = 406; // 正在联网的通知(会在联网开始之前发送该消息)
    public static final int NET_UINOTIFY_WAIT_CANCEL = 407; // 取消正在联网的通知(会在联网成功后发送该消息)
    public static final int NET_UINOTIFY_NET_FAILED = 408; // 联网失败
    public static final int NET_UINOTIFY_NET_MESSAGE = 409; // 联网弹出的信息
    public static final int NET_UINOTIFY_SYNC_CLIENT_OPER = 410; // 活动同步后客户端的操作

    public static final int NET_UNM_NOT_BIND_PHONE = 1001; // 未绑定手机号
    public static final int NET_UNM_HAS_BIND_PHONE = 1002; // 已经绑定手机号
    public static final int NET_UNM_DETECT_MSG = 1003; // 联网检测的数据
    public static final int NET_UNM_ERROR_PWD = 1004; // 错误的密码
    public static final int NET_SYNC_TRANSACTION_ERROR = 1005; // 活动同步联网错误

    public static final int NORMAL_MSG_TYPE = 0; // 普通消息类型
    public static final int ADVISE_MSG_TYPE = 4; // 广告消息
    public static final int PROMPT_MSG_TYPE = 1; // 用户确认消息类型
    public static final int PROGRESS_MSG_TYPE = 2; // 进度条完成的百分比消息
    public static final int SEND_SMS_MSG_TYPE = 3; // 发送短信的消息
    public static final int PROGRESS_MSG_TYPE_ERROR = 5; // 下载出现错误
    public static final int PROGRESS_MSG_TYPE_CANCEL = 6; // 下载时用户取消

    public static final int EXTRA_LAUNCH_ACTION = 0;// 身边
    public static final int EXTRA_LAUNCH_FRIEND = 1;// 好友
    public static final int EXTRA_LAUNCH_MINE = 2;// 我
    public static final int EXTRA_LAUNCH_SCHEDULE = 3;// 日程
    public static final int EXTRA_LAUNCH_MORE = 4;// 更多

    // 网络请求command
    public static final int REGISTER = 9; // 注册
    public static final int ORDER = 25; // 订购
    public static final int CANCELORDER = 31; // 退订
    public static final int DBUPDATE = 5; // 策略库更新
    public static final int RECOMMEND = 12; // 推荐
    public static final int SIMCHANGE = 27; // sim卡更换
    public static final int APPUPDATE = 6; // 组件更新
    public static final int DOWNLOADAPP = 7; // 下载组件
    public static final int USER_CONFIRM = 800; // 用户确认
    public static final int USER_CANCEL = 801; // 用户取消
    public static final int NET_CANCEL = 802; // 用户主动取消联网

    public static class SoftUpdateMsg {
        public int necessary; // 是否要强制更新：11-强制安装，12-非强制安装，13-静默强制安装
        public String promptMsg; // 提示消息
        public String systemMsg; // 系统消息
        public Vector<String> adMsg;// 广告消息
        public int apklen;
    }

    public final static String guidPrefexFromWeb = "w_";
    // public static String AppServerURL = "";
    // public static String UpdateServerURL = "";
    // public static String ContactServerURL = "";
    // public static String UserServerURL = "";
    // public static String RetievePasswdURL = "";
    // public static String uriBaseFeedBack = "";
    // public static String urlContactsBackUp = "";
    // public static String event_detail = "";
    // public static String deTailIndexValue = "";

    //
    // static{
    // switch(environment){
    // case 0:{ // release
    // AppServerURL = "http://123.124.209.72:8297/BOSS_CS_CAM_APP/cam.htm"; // 活动操作的联网地址
    // //AppServerURL = "http://release.netqin.com:8297/BOSS_CS_CAM_APP/cam.htm"; // 活动操作的联网地址
    // UpdateServerURL = "http://release.netqin.com:8297/BOSS_USServlet"; // 软件更新服务器
    // ContactServerURL = "http://release.netqin.com:8297/CommonContacts/app.htm"; // 通信录备份服务器地址
    // UserServerURL = "http://release.netqin.com:8297/BOSS_CS_CAM_APP/cam.htm";// 账户服务器地址
    // RetievePasswdURL = "http://vm.netqin.cn:4080/uc/goResetPassAndroid.html?l=zh_cn"; //
    // 找回密码正式服务器地址
    // uriBaseFeedBack = "http://www.netqin.com/feedback/report.jsp"; // 用户反馈
    // urlContactsBackUp = "http://123.124.209.89/m?code="; // 查看通讯录备份
    // event_detail = "http://release.netqin.com:8297/BOSS_CS_CAM_WEB/wap/v.do?u="; // 短信中的活动详情
    // deTailIndexValue = "u=";
    // }
    // break;
    // case 1:{ // verify
    // AppServerURL = "http://verify.netqin.com:8297/BOSS_CS_CAM_APP/cam.htm";
    // UpdateServerURL = "http://verify.netqin.com:8297/BOSS_USServlet";
    // ContactServerURL = "http://123.124.209.110:8297/BOSS_ComCon/app.htm";
    // UserServerURL = "http://verify.netqin.com:8297/BOSS_CS_CAM_APP/cam.htm";
    // RetievePasswdURL = "http://vf.netqin.cn:8297/uc/goResetPassAndroid.html?l=zh_cn";
    // uriBaseFeedBack = "http://123.124.209.99:1318/feedback/index.jsp";
    // urlContactsBackUp = "http://123.124.209.89/m?code=";
    // event_detail = "http://verify.netqin.cn:8297/BOSS_CS_CAM_WEB/wap/v.do?u=";
    // deTailIndexValue = "u=";
    // }
    // break;
    // case 2:{ // 正式
    // AppServerURL = "http://cal.netqin.com:8297/BOSS_CS_CAM_APP/cam.htm";
    // UpdateServerURL = "http://contentserver.netqin.com:8297/BOSS_USServlet";
    // ContactServerURL = " http://comcon.netqin.com/BOSS_ComCon/app.htm";
    // UserServerURL = "http://cal.netqin.com:8297/BOSS_CS_CAM_APP/cam.htm";
    // RetievePasswdURL = "http://www.netqin.com/uc/goResetPassAndroid.html?l=zh_cn";
    // uriBaseFeedBack = "http://www.netqin.com/feedback/report.jsp";
    // urlContactsBackUp = "http://i.netqin.com/m?code=";
    // event_detail = "http://cal.netqin.com/wap/v.do?u=";
    // deTailIndexValue = "u=";
    // }
    // break;
    // }
    // }
    //
    public static final String CMCCWapServer = "http://10.0.0.172";
    // 网络协议版本
    public static final String ProtocolVersion = "3.0.1";
    // 平台
    public static final String Model = Build.MODEL;
    // XML 请求头格式
    public static final String XML_HEAD = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
    // XML 请求开始
    public static final String m_szBeginTag = "<Request>\n";
    // XML 请求结束
    public static final String m_szEndTag = "</Request>";
    // 语言
    public static final String Language = "31"; // 中文31 ，英文 1
    public static final String LanguageStr = "zh_cn";
    // 国家
    public static final String Country = "86";
    // Http Post 请求时的参数
    public static final String PostParameter = "PostParameter";
    // 上一个页面的URL字段
    public static final String Referer = "Referer";

    public static final String timeZone = "8";

    // 回应报文字段名

    // 协议版本号
    public static final String Protocol = "2.2.1";
    // 命令值
    public static final String Command = "Command";
    // 会话ID
    public static final String SessionId = "SessionId";
    // 是否强制标识
    public static final String Mandatory = "Mandatory";
    // 网秦币
    public static final String Balance = "Balance";
    // 用户标识
    public static final String UID = "UID";
    // 手机串号
    public static final String IMEI = "IMEI";
    // sim卡串号
    public static final String IMSI = "IMSI";
    // 用户类型
    public static final String Level = "Level";
    public static final String SmsNumber = "SmsNumber";
    public static final String SmsContent = "SmsContent";
    public static final String SmsCount = "SmsCount";
    public static final String ConfirmContent = "ConfirmContent";
    public static final String NeedConfirm = "NeedConfirm"; // 发送短信是否需要二次确认。1代表需要，0代表不需要
    public static final String NumberMatch = "NumberMatch";
    public static final String ContentMatch = "ContentMatch";
    public static final String ConfirmNumber = "ConfirmNumber";
    public static final String ResumeTransaction = "ResumeTransaction";
    public static final String OperationType = "OperationType";
    public static final String NeedCheck = "NeedCheck";
    public static final String DeductType = "DeductType";

    public static final String SendSmsPrompType = "SendSmsPrompType"; // 发送短信，是否提示
    // 1代表提示
    // 0代表不提示
    // wap点击地址
    public static final String WapRechargeUrl = "WapRechargeUrl";
    // wap点击间隔时间
    public static final String WapRechargeInt = "WapRechargeInt";
    // wap点击模拟次数
    public static final String WapRechargeCount = "WapRechargeCount";
    // wap订购模拟规则
    public static final String WapRechargeSimulateRule = "WapRechargeSimulateRule";
    // wap订购成功标志
    public static final String WapRechargeOkSign = "WapRechargeOkSign";
    public static final String WapCheckTime = "WapCheckTime";
    // 客户端的短信中心号码
    public static final String SC = "SC";
    // 用户状态
    public static final String Status = "Status";
    // 还可以免费使用天数，只对免费用户有意义
    public static final String Expired = "Expired";
    // 距离下次包月付费的天数
    public static final String NextPayDay = "NextPayDay";
    // 客户端显示的用户类型名
    public static final String LevelName = "LevelName";
    // 私密空间是否可用 ，1表示可用，0表示不可用
    public static final String SecretSpaceUsable = "SecretSpaceUsable";
    // 垃圾短信过滤是否可用，1表示可用，0表示不可用
    public static final String SmsFilterUsable = "SmsFilterUsable";
    // 客户端使用的接入点的名称
    public static final String APN = "APN";
    // 客户端的公知黑白名单数据库版本
    public static final String BlackWhiteListDBVersion = "BlackWhiteListDBVersion";
    // 客户端的垃圾短信数据库版本
    public static final String TrashSMSDBVersion = "TrashSMSDBVersion";
    // 手机换卡时，旧手机卡的IMSI
    public static final String OldIMSI = "OldIMSI";
    // 手机换卡时，新手机卡的IMSI
    public static final String NewIMSI = "NewIMSI";
    // 是否是前后台 0是前台，1是后台
    public static final String Background = "Background";
    // 需要确认的消息
    public static final String Prompt = "Prompt";
    // 包月结果
    public static final String WapResult = "WapResult";
    // 回应报文包含的消息条数
    public static final String MessageCount = "MessageCount";
    // 垃圾短信数据
    public static final String TrashSMSData = "TrashSMSData";
    // 是否有额外信息
    public static final String HasExtraInfo = "HasExtraInfo";
    // 是否需要更新策略库 "1表示需要更新"。不需要更新，则不包含该字段
    // public static final String PolicyNeedToUpdate="PolicyNeedToUpdate";
    // http连接超时
    public static final int httpConnectionReadTimeout = 20000;
    public static final int httpConnectionConnectTimeout = 20000;

    public static final String TrashSMSDB_FILENAME = "TrashSMSDB"; // 垃圾短信语义策略库词典文件名
    public static final String BlackWhiteListDB_FILENAME = "BlackWhiteListDB"; // 公知黑白名单文件名

    // 策略库更新命令
    public static final int DBUpdateCommand = 5;
    // 注册命令
    public static final int RegisterCommand = 9;
    // 查询用户信息命令
    public static final int GetUserInfoCommand = 10;
    // 退订命令
    public static final int UnsubscribeCommand = 15;
    // 订购命令
    public static final int OrderCommand = 25;
    // SIM卡更换命令
    public static final int SIMChangeCommand = 27;
    // 组件更新命令
    public static final int AppUpdateCommand = 6;
    // 本地网络出错cmd
    public static final int LOCAL_NET_MSG = 100;

    // 策略库更新回应
    public static final int DBUpdateResponse = 5;
    // 错误回应
    public static final int ErrorResponse = 1;
    // 退订回应
    public static final int UnsubscribeResopnse = 15;
    // 中转回应
    public static final int TransferResponse = 24;
    // SIM卡更换回应
    public static final int SIMChangeResponse = 27;
    // 组件更新回应
    public static final int AppUpdateResponse = 6;
    // 组件更新文件的服务器地址
    public static final String AppUpdateSrc = "AppUpdateSrc";
    // 组件更新动作
    public static final String AppUpdateAction = "AppUpdateAction";
    // 组件更新消息类型
    public static final String AppUpdateMessageType = "AppUpdateMessageType";
    // 组件更新文件保存在本地的文件名
    public static final String AppUpdateFileName = "AppUpdateFileName";
    // 组件更新 强制标志
    public static final String UpdateNecessary = "Necessary";
    // 组件更新成功标志 "1"表示成功
    public static final String AppUpdateSuccess = "AppUpdateSuccess";
    // 策略库更新成功标志 "1"表示成功
    public static final String DBUpdateSuccess = "DBUpdateSuccess";
    // 组件更新更新后的组件版本
    public static final String AppVersion = "AppVersion";

    // 是否需要更新策略库 "1表示需要更新"。不需要更新，则不包含该字段
    public static final String PolicyNeedToUpdate = "PolicyNeedToUpdate";

    // 语言
    public static final String SoftLanguage = "31";
    // 短信订购请求,Command字段的值
    public static final int SMSOrder = 14;
    // 短信充值请求,Command字段的值
    public static final int SMSRecharge = 3;

    public static final String PromptMsg = "PromptMsg";

    public static final String PromptCount = "PromptCount";

    public static final int CheckBeforeUnsubscribe = 31;

    public static final int GetUserInfoResponse = 10;

    public static final String AppUpdateADMessageCount = "AppUpdateADMessageCount";

    public static final String AppUpdateSystemMsgCount = "AppUpdateSystemMsgCount";

    public static final String PaymentResult = "PaymentResult";

    public static final String SeqId = "SeqId";

    public static final String CheckDelay = "CheckDelay";

    public static final String CheckTimes = "CheckTimes";

    public static final String CheckInterval = "CheckInterval";

    public static final String ChannelCount = "ChannelCount";

    public static final String Body = "Body";

    public static final String ConfirmMatch = "ConfirmMatch";

    public static final String WapItem = "WapItem";

    public static final String WapItemCount = "WapItemCount";

    public static final String MsgType = "MsgType";

    public static final String Msg = "Msg";

    public static final String NextPageURL = "NextPageURL";

    public static final String TryExpired = "TryExpired";

    public static final int VipTrailCommand = 35;

    public static final String TryDays = "TryDays";

    // 点卡充值
    public static final int CardChargeCommand = 30;

    // 点卡号字段
    public static final String SerialNumer = "SerialNumber";

    // 点卡包月
    public static final int CardOrderCommand = 33;

    public static final String RechargeCount = "RechargeCount";

    public static final String CostCount = "CostCount";
    // 通信录服务相关字段
    // 通信录备份Command值
    public static final int Command_Backup_File = 901;
    // 通信录下载Command值
    public static final int Command_DownloadFile = 902;
    // 通信录上传状态值
    public static final int Command_UploadStatus = 903;
    // 错误信息
    public static final int Command_ErrorInfo = 909;

    public static final String OptionCount = "OptionCount";

    public static final String Option = "Option";

    public static final String WapItemType = "WapItemType";

    public static final String OptionID = "OptionID";

    public static final String SmsShow = "SmsShow";

    public static final String SmsDel = "SmsDel";

    public static String WaitTime = "waittime";

    public static final String DownLoadFileName = "DownLoadFileName";

    public static final String Path = "PATH";

    public static final int SHOW_COST_LIST_MSG_VALUE = 406; // 订购短信超时消息

    public static final String Message = "Message";

    public static final String SysMessage = "SystemMessage";

    public static final String SubscribeScene = "SubscribeScene";

    public static final String OptionSelected = "OptionSelected";

    public static final int LOCAL_ERROR = 0x1001;

    public static final int LOCAL_SMS_RECHAREG = 0x1002;

    public static final int LOCAL_DBUPDATE = 0x1003; // 策略库更新

    public static final int LOCAL_APP_UPDATE = 0x1004; // 组件更新

    public static final int LOCAL_DOWNLOADAPP = 0x1005; // 下载组件

    public static final int LOCAL_REGISTER = 0x1006; // 注册

    public static final int LOCAL_GET_USER_INF = 0x1007;

    public static final int LOCAL_RECOMMEND = 0x1008; // 推荐

    public static final int LOCAL_SMS_ORDER = 0x1009;

    public static final int LOCAL_UNSUBSCRIBE = 0x100A;

    public static final int LOCAL_TRANSFER = 0x100B;

    public static final int LOCAL_ORDER = 0x100C; // 订购

    public static final int LOCAL_SIM_CHANGE = 0x100D; // sim卡更换

    public static final int LOCAL_CARD_CHARGE = 0x100E;

    public static final int LOCAL_PRE_CHECK = 0x100F; // 退订

    public static final int LOCAL_CARD_ORDER = 0x1010;

    public static final int LOCAL_VIP_TRAIL = 0x1011;

    public static final int LOCAL_YELLOW_PAGES_UPDATE = 0x1012;

    public static final int LOCAL_DOWNLOAD_YELLOW_PAGES = 0x1013;

    public static final int LOCAL_CHARGE = 0x1014; // charge

    public static final int LOCAL_GET_ORDER_NUM = 0x1015;// 获取订单号

    public static final int LOCAL_CHECK = 0x1016;

    public static final int LOCAL_DOWNLOAD_DB = 0x1017;

    public static final int LOCAL_MULTI_COST_STANDARD = 0X1018;

    public static final int LOCAL_APP_UPDATE_BACK = 0X1019; // 后台联网更新

    public static final int LOCAL_CODE_VERIFY = 0x1020; // 验证码请求协议

    // 通信录备份Command值
    public static final int LOCAL_BACKUP_FILE = 0x2001;

    // 通信录下载Command值
    public static final int LOCAL_DOWNLOAD_FILE = 0x2002;

    // 通信录上传状态值
    public static final int LOCAL_UPLOAD_STATUS = 0x2003;

    // 错误信息
    public static final int LOCAL_ERROR_INFO = 0x2004;

    // 通信录账户创建命令
    public static final int LOCAL_CREATE_ACCOUNT = 0x3001;
    // 通讯录账户创建命令&UID
    public static final int LOCAL_CREATE_ACCOUNT_WITH_UID = 0x3007;
    // 通信录备份账户登录命令
    public static final int LOCAL_LOGIN = 0x3002;
    // 账户登录&激活命令
    public static final int LOCAL_LOGIN_WITH_UID = 0x3006;
    // 通信录备份账户密码修改命令
    public static final int LOCAL_CHANGE_PASSWD = 0x3003;

    public static final int LOCAL_RETRIVE_PASSWD = 0x3004;

    // 通信录备份账户创建时，检查用户名是否可用请求，Command字段取的值
    public static final int LOCAL_ACCOUNT_CHECK = 0x3005;

    public static final int LOCAL_DETECTION = 0x4001; // 活动检测协议

    public static final int LOCAL_SYNCHRONIZATION = 0x4002; // 活动同步协议

    public static final int LOCAL_ACTIVATION = 0x4003; // 日程管家激活协议

    public static final int LOCAL_ACTION_RSP = 0x4004; // 用户

    public static final int LOCAL_BIND_MOBILE = 0x4005; // 绑定手机号协议

    public static final int LOCAL_WEIBO_LOGIN = 0x4006; // 微博登录

    public static final int LOCAL_BIND_NETQIN_PASS = 0x4007; // 绑定网秦通行证

    public static final int LOCAL_OBTAIN_SINA_PHONE = 0x4008; // 获取sina短信通道号码协议

    public static final int LOCAL_OBTAIN_BACKUP_INFO = 0x4009; // 获取上次备份时间和备份联系人个数

    // net command
    // net command
    public static final int NET_DETECTION = 1;
    public static final int NET_ERROR = 1;
    public static final int NET_SMS_RECHAREG = 3;
    public static final int NET_DBUPDATE = 5; // 策略库更新
    public static final int NET_APP_UPDATE = 6; // 组件更新
    public static final int NET_DOWNLOADAPP = 7; // 下载组件
    public static final int NET_REGISTER = 9; // 注册
    public static final int NET_GET_USER_INF = 10;
    public static final int NET_RECOMMEND = 12; // 推荐
    public static final int NET_SMS_ORDER = 14;
    public static final int NET_UNSUBSCRIBE = 15;
    public static final int NET_TRANSFER = 24;
    public static final int NET_ORDER = 25; // 订购
    public static final int NET_SIM_CHANGE = 27; // sim卡更换
    public static final int NET_CARD_CHARGE = 30;
    public static final int NET_PRE_CHECK = 31; // 退订
    public static final int NET_CARD_ORDER = 33;
    public static final int NET_MULTI_COST_STANDARD = 34;
    public static final int NET_VIP_TRAIL = 35;
    public static final int NET_YELLOW_PAGES_UPDATE = 36;
    public static final int NET_DOWNLOAD_YELLOW_PAGES = 37;
    public static final int NET_CHARGE = 38; // charge
    public static final int NET_GET_ORDER_NUM = 39;// 获取订单号
    public static final int NET_CHECK = 40;
    // 通信录备份Command值
    public static final int NET_BACKUP_FILE = 901;
    // 通信录下载Command值

    public static final int NET_DOWNLOAD_FILE = 902;
    // 通信录上传状态值
    public static final int NET_UPLOAD_STATUS = 903;
    // 错误信息
    public static final int NET_ERROR_INFO = 909;
    // 通信录账户创建命令
    public static final int NET_CREATE_ACCOUNT = 1;

    // 通信录账户创建命令&UID激活
    public static final int NET_CREATE_ACCOUNT_WITH_UID = 6;
    // 通信录备份账户登录命令
    public static final int NET_LOGIN = 2;
    // 帐户登录时&UID激活
    public static final int NET_LOGIN_WITH_UID = 7;
    // 通信录备份账户密码修改命令
    public static final int NET_CHANGE_PASSWD = 3;

    public static final int NET_RETRIVE_PASSWD = 4;

    // 通信录备份账户创建时，检查用户名是否可用请求，Command字段取的值
    public static final int NET_ACCOUNT_CHECK = 5;

    public static final int NET_DOWNLOAD_DB = 6;

    // 基站ID
    public static final String CellID = "CellID";

    public static final String LAC = "LAC";

    public static final String AppUpdateFileLength = "AppUpdateFileLength";

    public static final String ContactBackupProtocolVersion = "1.0.0";

    public static final String FileType = "FileType";

    public static final String Password = "Password";

    public static final String Username = "Username";

    public static final String ContentType = "ContentType";

    public static final String UploadUrl = "UploadUrl";

    public static final String PacketStatus = "PacketStatus";

    public static final String TotalStatus = "TotalStatus";

    public static final String DownloadUrl = "DownloadUrl";

    public static final String FOOD_RESTAURANT_PAGE = "FOOD_RESTAURANT_PAGE";

    public static final String FOOD_RESTAURANT_URL = "FOOD_RESTAURANT_URL";

    public static final String SMALL_BITMAP = "SMALL_BITMAP";

    private static String CAMERA_PATH;

    public static String getCameraPath() {
        if (TextUtils.isEmpty(CAMERA_PATH)) {
            CAMERA_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/";
        }
        return CAMERA_PATH;
    }

    // 通信录账户创建的email字段
    public static final String Email = "email";
    // 通信录备份账户密码修改的新密码字段
    public static final String NewPassword = "NewPassword";

    public static final String Bindmobile = "bindmobile";

    public static final String Devicetoken = "devicetoken";

    public static final int PacketLength = 10240;

    public static final String UploadFileSuccess = "UploadFileSuccess";

    public static final String VCardFileLength = "VCardFileLength";

    public static final int AVDBDownloadCommand = 201;

    public static final String ContactRestoreSuccess = "ContactRestoreSuccess";

    public static final String UploadFileName = "UploadFileName";

    public static final String SQRT = "\n";

    public static final int REQUEST_CODE_ACCOUNT_MANAGER = 101; // 通行证管理
    public static final int REQUEST_CODE_USER_GUIDE = 102; // 向导页
    public static final int REQUEST_CODE_EVENT_OPERATOR = 103; // 活动修改
    public static final int REQUEST_CODE_HPERLINK = 104; // 超链接
    public static final int REQUEST_CODE_BACKUP_CONTACTS = 105; // 备份通讯录
    public static final int REQUEST_CODE_ADD_NEW_SCHEDULE = 106; // 添加活动
    public static final int REQUEST_CODE_SCHEDULE_DETAIL = 107; // 打开活动详情页面
    public static final int REQUEST_CODE_ADD_BIND_PHONE = 108; // 添加绑定的手机号

    public static final int REQUEST_CODE_ALARM_CALENDAR_REMIND_FIRST = 109; // 活动提醒（第一次提醒）
    public static final int REQUEST_CODE_ALARM_CALENDAR_REMIND_SECOND = 110; // 活动提醒（第二次提醒）
    public static final int REQUEST_CODE_ALARM_CALENDAR_REMIND_ICON = 111; // 活动提醒在通知栏上
    public static final int REQUEST_CODE_CALENDAR_NOTIFY = 112; // 活动通知
    public static final int REQUEST_CODE_CITY_SETTING = 113; // 主界面中要调用的
    public static final int REQUEST_CODE_SHOW_DISCLAIM = 114; // 显示许可协议
    public static final int REQUEST_CODE_FIRST_LOGIN = 115; // 从登录界面调起的新界面
    public static final int REQUEST_CODE_CREATE_ACCOUNT = 116; // 从创建通行证界面调起的新界面
    public static final int RESULT_BIND_WEIBO_SINA = 117; // 绑定新浪微博

    public static final int RESULT_CODE_LOGIN_SUCCESS = 102; // 登录成功
    public static final int RESULT_CODE_REGISTER_SUCCESS = 103; // 创建成功
    public static final int RESULT_CODE_LOGOUT = 104; // 注销
    public static final int RESUlT_CODE_MODIFY_SUCCESS = 105; // 修改活动成功
    public static final int RESULT_CODE_FORWARDING_SUCCESS = 106; // 转发成功
    public static final int RESULT_CODE_BACKUP_SUCCESS = 107; // 备份成功
    public static final int RESULT_CODE_ADD_NEW_SCHEDULE = 108; // 添加活动
    public static final int RESULT_CODE_LAUNCH_PERSONAL_ACTIVITY = 109; // 发起个人活动
    public static final int RESULT_CODE_CREATE_ACCOUNT_WITH_EMAIL = 110; // 用邮箱创建
    public static final int RESULT_CODE_CREATE_ACCOUNT_WITH_PHONE = 111; // 用手机号创建
    public static final int RESULT_CODE_LOGIN_WITH_PHONE = 112; // 立刻用手机号登录
    public static final int RESULT_CODE_SWITCH_BIND_MOBILE_SUCCESS = 113; // 切换绑定的手机号成功
    public static final int RESULT_CODE_DISCLAIM_ACCEPTE = 114; // 接受许可协议
    public static final int RESULT_CODE_DISCLAIM_REFUSE = 115; // 拒绝许可协议
    public static final int RESULT_BIND_PHONE = 116; // 绑定手机号成功
    public static final int RESULT_BIND_PHONE_FAIL = 117; // 绑定手机号失败
    public static final int RESULT_CODE_LOGIN_SUCCESS_BY_WEIBO_NO_FIRST = 118; // 用新浪微博登录成功（不是第一次登录）
    public static final int RESULT_CODE_LOGIN_SUCCESS_BY_WEIBO_FIRST = 119; // 用新浪微博第一次登录成功
    public static final int RESUlT_CODE_JOIN_TODAY_SEC = 120; // 从日程详情界面进入 今日日程
    public static final int RESULT_CODE_FRIEND_FEEDS = 121; // 返回到friendFeeds界面，并且进行刷新
    public static final int RESULT_CODE_MY_HOME = 122; // 返回到主页
    public static final int RESULT_CODE_DELETE_SCHEDULE = 123;// 删除日程
    public static final int RESULT_LAUNCH_BIND_PHONE = 124; // 发起绑定手机号请求
    public static final int PHOTO_AFFECT_ADD_FOOD_NAME_REQUEST_CODE = 0;
    public static final int PHOTO_AFFECT_ADD_RESTAURANT_REQUEST_CODE = 1;
    public static final int ADD_FEED_AND_COMMENT_AT = 2;
    public static final int ADD_FEED_AND_COMMENT_PHOTO = 3;
    public static final int ADD_FEED_AND_COMMENT_CAMERO = 4;
    public static final int ADD_FEED_AND_COMMENT_PHOTO_EFFECT = 5;
    public static final String ATFRIENDS = "at_friends";
    public static final String DefaultIconName = "default_icon_name";
    public static final String PHOTO_AFFECT_URI = "PHOTO_AFFECT_URI";

    public static final String defaultUpdateAt = "";

    public static final String TYPE = "type";
    public static final String DEFAULT_TIPS = "default_tips";
    public static final String FEED_ID = "feed_id";
    public static final String USER_ID = "user_id";
    public static final String PARENT_ID = "parent_id";
    public static final String USER_NAME = "user_name";
    public static final String GENDER = "gender";
    public static final String URL = "url";
    public static final String SERIALIZABLE = "serializable";
    public static final String NQ_TYPE = "nq_type";
    public static final String RF_TYPE = "rf_type";
    public static final String MY_URL = "my_url";
    public static final String RF_ID = "rf_id";
    public static final String RF_NAME = "rf_name";
    /** 关键字 user{{id,'name'}} */
    public static final String USER_KEYWORDS = "user_keywords";
    /** 页面来源 */
    public static String PAGE_FROM = "";
    public static final String PAGE_FRIENDS = "FRIENDS";
    public static final String PAGE_INTRO = "INTRO";
    public static final String PAGE_MY_HOME = "PAGE_MY_HOME";
    public static final String PHOTO_AFFECT_ADD_FOOD = "PHOTO_AFFECT_ADD_FOOD";
    public static final String PHOTO_AFFECT_ADD_TYPE = "PHOTO_AFFECT_ADD_TYPE";
    public static final String PHOTO_AFFECT_ADD_NAME = "PHOTO_AFFECT_ADD_NAME";
    public static final String PHOTO_AFFECT_ADD_ID = "PHOTO_AFFECT_ADD_ID";
    public static final String PHOTO_AFFECT_ADD_RESTRAUT_ID = "PHOTO_AFFECT_ADD_RESTRAUT_ID";
    public static final String PHOTO_AFFECT_ADD_FOOD_ID = "PHOTO_AFFECT_ADD_FOOD_ID";
    public static final String PHOTO_AFFECT_ADD_RESTRAUT = "PHOTO_AFFECT_ADD_RESTRAUT";
    public static final String PHOTO_AFFECT_ADD_PHOTO = "PAGE_MY_HOME";
    /** 订阅分类 */
    public static final String SUBSCRIBE = "SUBSCRIBE";
    public static final int ZERO = 0;
    public static final int ONE = 1;
    public static final int TWO = 2;
    public static final int THREE = 3;
    public static final int FOUR = 4;
    public static final int FIVE = 5;
    /** 发布Feed */
    public static final int ADD_FEED = 0;
    /** 想吃 */
    public static final int WANT_2_EAT = 1;
    /** 想看 */
    public static final int WANT_2_SEE = 2;
    /** 吃过 */
    public static final int HAVE_EATEN = 3;
    /** 看过 */
    public static final int HAVE_SEEN = 4;
    /** 分享 */
    public static final int SHARE_EXC = 5;
    /** 我要发布评论电影 */
    public static final int WANT2COMMENTFILM = 6;
    /** 我要发布评论 美食 */
    public static final int WANT2COMMENTFOOD = 7;
    /** 发布美食图片 */
    public static final int BRODCAST_FOOD = 8;

    /**
     * display label in feed
     * 
     * @param type
     * @return
     */
    public static boolean enableLabelInFeed(int type) {
        return (type == Value.HAVE_EATEN)
                || (type == Value.WANT_2_EAT) || (type == BRODCAST_FOOD) || (type == Value.ADD_FEED) || (type == Value.WANT2COMMENTFOOD);
    }

    public static boolean unClick(int type) {
        return (type == Value.HAVE_EATEN)
                || (type == Value.WANT_2_EAT) || (type == BRODCAST_FOOD)
                || (type == Value.WANT2COMMENTFOOD || (type == Value.WANT2COMMENTFILM));
    }

    /** 创建日程绑定手机号 **/
    public static final String CREATE_SCH = "CREATE_SCH";

    public static final String PAGE_PHOTO_AFFECT = "PAGE_PHOTO_AFFECT";
    public static final String PAGE_ADD_FEEDS = "PAGE_ADD_FEEDS";
    public static String pageFrom = PAGE_PHOTO_AFFECT;
    // 序列化类UID统一定义
    public static final long UID_AdListRequest = 101L;
    public static final long UID_EventAd = 102L;
    public static final long UID_RollingAd = 103L;
    public static final long UID_FeedList = 104L;
    public static final long UID_Feed = 105L;
    public static final long UID_ProfileList = 106L;
    public static final long UID_Profile = 107L;
    public static final long UID_FeedListRequest = 108L;
    public static final long UID_PublicProfileTag = 109L;
    public static final long UID_Buddy28 = 110L;
    public static final long UID_CategoryListRequest = 111L;
    public static final long UID_Category = 112L;
    public static final long UID_HomePage = 113L;
    public static final long UID_ProfileTag = 114L;

    // 我的主页
    public static final int RESULT_FINISH = 10;
    public static final String PROFILE = "rofile";
    public static final String MYSIGN = "sign";// 个性签名的KEY
    public static final String MYTAG = "tag";// 标签的KEY
    public static final int ACTION_FROM_SIGN = 3;// ResultCode从个性签名返回据
    public static final int ACTION_FROM_MYTAG = 4;// ResultCode从我的标签
    public static final String SEARCHFRIEND_FLAG = "SEARCHFRIEND_FLAG";
    public static final String FROM_CAM = "from_cam";
    // 日程相关
    public static final String SCHEDULE_ID_TAG = "activityID";

    // 屏幕尺寸和密度
    public static int getScreenWidth(Activity activity) {
        ensureScreenMeasured(activity);
        return Value.SCREEN_WIDTH;
    };

    public static int getScreenHeight(Activity activity) {
        ensureScreenMeasured(activity);
        return SCREEN_HEIGHT;
    };

    public static float getScreenDensity(Activity activity) {
        ensureScreenMeasured(activity);
        return SCREEN_DENSITY;
    }

    static void ensureScreenMeasured(Activity activity) {
        if (!sScreenMeasured) {
            initScreenSize(activity);
            sScreenMeasured = true;
        }
    }
    
    static void initScreenSize(Activity window) {
        DisplayMetrics dm = new DisplayMetrics();
        window.getWindowManager().getDefaultDisplay().getMetrics(dm);
        Value.SCREEN_WIDTH = dm.widthPixels;
        Value.SCREEN_HEIGHT = dm.heightPixels;
        Value.SCREEN_DENSITY = window.getResources().getDisplayMetrics().density;
        if (Value.printLog) {
            NqLog.d("DisplayMetrics " + dm.toString());
        }
    }

    public static int SCREEN_WIDTH = 480;
    public static int SCREEN_HEIGHT = 800;
    public static float SCREEN_DENSITY = 0;
    public static boolean sScreenMeasured;

    // 扩大view点击区域常量
    public static final int HIT_RECT_ENLARGE_SCALE = 200;// 2倍

    /** 好友发生变化后需要刷新页面 */
    public static boolean isNeedRefresh = false;
    public static boolean rom = false; // 是否是rom预装
    public static boolean phone = true;

    public static Object sObject = new Object();
    public static Boolean mNeedHandleVerifySms = false;
    /** 是否启用软件自动更新 默认更新 */
    public static boolean mIsNeedSoftwareUpdate = true;
    /** 播放电影预告片时，弹出的提示标志，为假时，说明未弹过提示；为真说明已弹过提示 */
    public static boolean mIsVideoPlayTip = false;
    /**
     * 应用程序处于前后台的字符串标识，用于周期联网时的协议请求
     */
    public static final String KBackgroundApp = "BACKGROUND";
    public static final String KForgoundApp = "FOREGROUND";
    /** 网络视频url */
    public static final String MEDIA_URL = "media_url";
    /** 主程序文件名 */
    public static final String MAIN_ACTIVITY_NAME = "com.netqin.schedule.sc.NetqinTabMain";
    /** 图片宽度 */
    public static final String PIC_WIDTH = "pic_width";
    /** 图片高度 */
    public static final String PIC_HEIGHT = "pic_height";
    /** 本地图片标志 */
    public static final String LOCAL_PHOTO = "local_photo";
    /** 本地图片路径 */
    public static final String LOCAL_PHOTO_URI = "local_photo_uri";
    // 状态栏上通知的id
    public static final int NQ_SCHEDULE_CHANGE_NOTIFY = 1; // 日程变化
    public static final int NQ_SCHEDULE_ALARM_NOTIFY = 2; // 闹铃提醒
    public static final int NQ_START_AUTO_SYNC = 3; // 自动同步
    public static final int NQ_FEEDS_MESSAGE_NOTIFY = 4; // 新动态提醒
    public static final int NQ_NET_TRANSACTION_MESSAGE = 5; // 后台联网

    public static final String kAndroidMarketPackageName = "com.android.vending";

    public static final int kMaxMessageDisplay = 99;// 消息显示的最大数量
    /** 是否点击了注销 */
    public static boolean isLogout = false;
    
    /** 新浪微博认证参数*/
//    public static final String CONSUMER_KEY = "3680254141";
//	public static final String CONSUMER_SECRET = "690a28840c5018addf1894acacc3f5b1";
//	public static final String CONSUMER_REDIRECTURL = "http://wwww.netqin.cn";
	
	public static final String CONSUMER_KEY = "1583216112";
	public static final String CONSUMER_SECRET = "b111c35515368db357361942faad2e04";
	public static final String CONSUMER_REDIRECTURL = "http://www.netqin.com";
	/**请求网络头像所属用户ID*/
	public static final String REQUEST_HEAD_ICON_ID = "request_head_icon_id";
	/**请求网络头像地址*/
	public static final String REQUEST_HEAD_ICON_URLPATH = "request_head_icon_urlpath";
}
